home *** CD-ROM | disk | FTP | other *** search
- #include <WM.h>
- #include <MyStructs.h>
- #include <Prefs.h>
-
- VOID SetzPrefs(UBYTE m)
- {
- i= (m & 2) ? 5 : 4;
- PText[1].IText=GTexte[i];
- i= (m & 4) ? 3 : 2;
- PText[2].IText=GTexte[i];
- i= (m & 1) ? 7 : 6;
- PText[0].IText=GTexte[i];
- i= (m & 8) ? 2 : 3;
- PText[3].IText=GTexte[i];
- RefreshGList(&PrefGad[6],Wwin,NULL,4);
- }
- VOID NewPrefs()
- {
- Compiler = (PREFSBYTE[0] & 1) ? 1 : 0;
- Kompact = (PREFSBYTE[0] & 2) ? 0 : 1;
- Warning = (PREFSBYTE[0] & 4) ? 1 : 0;
- FarbKopie = (PREFSBYTE[0] & 8) ? 1 : 0;
- }
- VOID PrintText(ULONG zahl,SHORT ypo,UBYTE col)
- {
- sprintf(LEER,"%ld",zahl);
- text(Wrp,2,LEER,182,ypo+1);
- text(Wrp,col,LEER,180,ypo);
- }
- USHORT Prefs()
- {
- USHORT OKB=TRUE;
- ULONG chip_mem,fast_mem;
- ScreenToFront(WMsc);
- PRWindow.Screen=WMsc;
- if(!(Wwin=(struct Window *)OpenWindow(&PRWindow))) return(1);
- WinBorder(Wwin);
- Wrp=Wwin->RPort;
- SetzPrefs(PREFSBYTE[0]);
- PrintIText(Wrp,&PText[14],0,0);
- StrEnd=PREFSBYTE[0];
- chip_mem=AvailMem(MEMF_CHIP);
- fast_mem=AvailMem(MEMF_FAST);
- PrintText(chip_mem,139,1);
- PrintText(fast_mem,149,1);
- PrintText(chip_mem+fast_mem,159,3);
- do
- {
- Wait(1L << Wwin->UserPort->mp_SigBit);
- GetMessage(Wwin);
- switch(class)
- {
- case GADGETUP:
- switch(Id)
- {
- /* ENDE */
- case 0: OKB=FALSE;
- break;
- /* O K */
- /* SAVE */
- case 1:
- case 2: PREFSBYTE[0]=StrEnd;
- NewPrefs();
- OKB=FALSE;
- if(Id==1)
- {
- if(!(Datei=Open("WM_Prefs",MODE_NEWFILE)))
- Error(1,1,1);
- else
- {
- if(write=Write(Datei,PREFSBYTE,sizeof(PREFSBYTE))
- != sizeof(PREFSBYTE))
- Error(1,1,1);
- if(write=Write(Datei,WMColors,sizeof(WMColors))
- != sizeof(WMColors))
- Error(1,1,1);
- }
- if(Datei) Close(Datei);
- }
- break;
- } /* switch Id */
- break;
-
- case GADGETDOWN:
- switch(Id)
- {
- /* Kompact */
- case 3: StrEnd ^= 2;
- SetzPrefs(StrEnd);
- break;
- /* Warnungen */
- case 4: StrEnd ^= 4;
- SetzPrefs(StrEnd);
- break;
- /* C-Compiler */
- case 5: StrEnd ^= 1;
- SetzPrefs(StrEnd);
- break;
- /* Farb-Kopie */
- case 6: StrEnd ^= 8;
- SetzPrefs(StrEnd);
- break;
- } /* switch Id */
- break;
- } /* switch class */
- } while(OKB); /* do */
- CloseWindow(Wwin);
- Work();
- ScreenToFront(sc);
- Ready();
- return(0);
- }
-
-
-